/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "plancurricular")
@NamedQueries({
    @NamedQuery(name = "Plancurricular.findAll", query = "SELECT p FROM Plancurricular p"),
    @NamedQuery(name = "Plancurricular.findByNPlnCrrId", query = "SELECT p FROM Plancurricular p WHERE p.nPlnCrrId = :nPlnCrrId"),
    @NamedQuery(name = "Plancurricular.findByVNombre", query = "SELECT p FROM Plancurricular p WHERE p.vNombre = :vNombre"),
    @NamedQuery(name = "Plancurricular.findByDtFchIni", query = "SELECT p FROM Plancurricular p WHERE p.dtFchIni = :dtFchIni"),
    @NamedQuery(name = "Plancurricular.findByVEstado", query = "SELECT p FROM Plancurricular p WHERE p.vEstado = :vEstado")})
public class Plancurricular implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "nPlnCrrId")
    private Integer nPlnCrrId;
    @Size(max = 60)
    @Column(name = "vNombre")
    private String vNombre;
    @Column(name = "dtFchIni")
    @Temporal(TemporalType.DATE)
    private Date dtFchIni;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nPlnCrrId")
    private List<Asignatura> asignaturaList;
    @JoinColumn(name = "nDrcEscId", referencedColumnName = "nDrcEscId")
    @ManyToOne(optional = false)
    private Direccionescuela nDrcEscId;

    public Plancurricular() {
    }

    public Plancurricular(Integer nPlnCrrId) {
        this.nPlnCrrId = nPlnCrrId;
    }

    public Integer getNPlnCrrId() {
        return nPlnCrrId;
    }

    public void setNPlnCrrId(Integer nPlnCrrId) {
        this.nPlnCrrId = nPlnCrrId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public Date getDtFchIni() {
        return dtFchIni;
    }

    public void setDtFchIni(Date dtFchIni) {
        this.dtFchIni = dtFchIni;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Asignatura> getAsignaturaList() {
        return asignaturaList;
    }

    public void setAsignaturaList(List<Asignatura> asignaturaList) {
        this.asignaturaList = asignaturaList;
    }

    public Direccionescuela getNDrcEscId() {
        return nDrcEscId;
    }

    public void setNDrcEscId(Direccionescuela nDrcEscId) {
        this.nDrcEscId = nDrcEscId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nPlnCrrId != null ? nPlnCrrId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Plancurricular)) {
            return false;
        }
        Plancurricular other = (Plancurricular) object;
        if ((this.nPlnCrrId == null && other.nPlnCrrId != null) || (this.nPlnCrrId != null && !this.nPlnCrrId.equals(other.nPlnCrrId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Plancurricular[ nPlnCrrId=" + nPlnCrrId + " ]";
    }
    
}
